home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-01-26 | 1.9 KB | 55 lines |
- ' *******************************************************
- ' *** ***
- ' *** Wash Procedure ***
- ' *** ***
- ' *** by ***
- ' *** ***
- ' *** Joseph Bolin ***
- ' *** ***
- ' ********************************************************
-
- Dim _WASH(64)
- Screen Open 0,320,200,4,Lowres
- Flash Off
- Palette $0,$800,$80,$8
- _WASH(0)=2 : _WASH(3)=0 : _WASH(1)=3
- Cls 1
- Ink 3 : Bar 0,0 To 63,63
- Ink 0 : Bar 64,64 To 128,128
- _WASH[32,32,200,160]
-
- Procedure _WASH[_STARTX,_STARTY,_ENDX,_ENDY]
-
- ' Wash an area of the screen
- '
- ' Inputs: _STARTX,_STARTY Coordinates of up-left
- ' _ENDX,_ENDY Coordinates of down-right
- ' _WASH() Wash table: _WASH(x)=Color to change color x to
- '
- ' Outputs: Washs an area of the screen
-
- Shared _WASH()
- If Screen<0 Then Error 47
- For BNK=10 To 65535
- If Length(B)=0 Then Exit
- Next
- Reserve As Work BNK,64
- For C=0 To Screen Colour-1
- Poke Start(BNK)+C,_WASH(C)
- Next
- CH:
- If _STARTX<0 Then _STARTX=0
- If _STARTY<0 Then _STARTY=0
- If _ENDX<_STARTX Then Swap _ENDX,_STARTX : Goto CH
- If _ENDY<_STARTY Then Swap _ENDY,_STARTY : Goto CH
- If _STARTX>=Screen Width Then _STARTX=Screen Width-1
- If _ENDX>=Screen Width Then _ENDX=Screen Width-1
- If _STARTY>=Screen Height Then _STARTY=Screen Height-1
- If _ENDY>=Screen Height Then _ENDY=Screen Height-1
- BIT=7-(_STARTX and 7)
- OFF=(_STARTX+_STARTY*Screen Width)/8
- WASHML[Screen Base,Start(BNK),OFF,BIT,_ENDX-_STARTX+1,_ENDY-_STARTY+1]
- End Proc
- Procedure WASHML[SCB,BNKB,OFF,BIT,WID,HE]
- ' COMPILED PROCEDURE -- can't convert this to AMOS code
- End Proc